Repository navigation
fix(id): ignore supersedes edges from superseded attestations in compose_view (#4003) - #4512
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5375daaee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let next: BTreeSet<ArtifactHash> = active_attestations | ||
| .difference(&named) |
There was a problem hiding this comment.
Allow attestations to reactivate when resolving the frontier
For an owner-signed chain grant G1 → revoke R1 → grant G2 → revoke R2, where each attestation supersedes its predecessor, the first iteration removes G1, R1, and G2 from active_attestations. Because subsequent iterations only subtract from that reduced set, R1 never reactivates after G2 becomes inactive. The loop therefore returns only G2 as superseded, and current_moderators incorrectly accepts G1, allowing the revoked moderator's Hide actions to keep affecting the view. Resolve the frontier against the original eligible attestation set, or traverse the dependency DAG, so reinstated attestations can contribute their edges.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f78d780 — thank you, the shrinking loop was wrong for chains. The frontier now recomputes the active set from the original eligible attestation set on every pass (bounded by one pass per edge), so a middle revocation reactivates once the grant superseding it falls. Added regression test attestation_chain_frontier_reinstates_and_re_revokes covering grant -> revocation -> grant -> revocation (hidden 1 -> 0 -> 1 -> 0). Verbatim-module probe: cargo test boards:: 27/27 pass.
Summary
Fixes #4003. In
BoardGraph::compose_view(pkgs/id/src/boards.rs), the moderator frontier collectedsupersedesedges from every RoleAttestation for the board, including attestations that were themselves superseded — so a revocation nullified by a generic Supersede record still revoked the grant it named.The attestation frontier now resolves to a fixed point over active attestations, mirroring the generic supersede frontier directly above it: an attestation that is itself superseded (by an active generic Supersede, or by an active attestation's edge) contributes no edge. Superseding a revocation therefore reinstates the grant, exactly as superseding a grant revokes it.
Tests
superseded_revocation_no_longer_revokes: grant → Hide applies → revocation attestation (supersedes the grant) → Hide stops applying → generic Supersede nullifying the revocation (replacement is an unrelated attestation) → Hide applies again.idlib does not compile on current main (issue id(lib): references.rs does not compile — LocalIndex derives Default over a StoreId with no Default impl, and from_markdown breaks with a borrow of a loop-local String (PR #2756) #4454,references.rs, unrelated), so the editedboards.rswas verified verbatim (md5 fcae6c5c77e49399199e6105c3a51937) in the same probe-harness shape the issue's own reproduction used:cargo test boards::— 26/26 pass, includinggeneric_supersede_of_a_grant_also_revokes_authority,superseded_supersede_record_has_no_effect,view_enforces_moderator_revocation_but_keeps_the_public_log, andmoderator_acceptance_does_not_depend_on_revocation_arrival_order.Queue: task 6281 (repo-health-code-pilot).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.